.graphiql-doc-explorer-search {
  color: hsla(var(--color-neutral), var(--alpha-secondary));

  &:not([data-state='idle']) {
    border: var(--popover-border);
    border-radius: var(--border-radius-4);
    box-shadow: var(--popover-box-shadow);
    color: hsl(var(--color-neutral));

    & .graphiql-doc-explorer-search-input {
      background: hsl(var(--color-base));
    }
  }
}

.graphiql-doc-explorer-search-input {
  align-items: center;
  background-color: hsla(var(--color-neutral), var(--alpha-background-light));
  border-radius: var(--border-radius-4);
  display: flex;
  padding: var(--px-8) var(--px-12);
}

.graphiql-doc-explorer-search [role='combobox'] {
  border: none;
  background-color: transparent;
  margin-left: var(--px-4);
  width: 100%;

  &:focus {
    outline: none;
  }
}

.graphiql-doc-explorer-search [role='listbox'] {
  background-color: hsl(var(--color-base));
  border: none;
  border-bottom-left-radius: var(--border-radius-4);
  border-bottom-right-radius: var(--border-radius-4);
  border-top: 1px solid
    hsla(var(--color-neutral), var(--alpha-background-heavy));
  max-height: 400px;
  overflow-y: auto;
  margin: 0;
  font-size: var(--font-size-body);
  padding: var(--px-4);
  /**
   * This makes sure that the logic for auto-scrolling the search results when
   * using keyboard navigation works properly (we use `offsetTop` there).
   */
  position: relative;
}

.graphiql-doc-explorer-search [role='option'] {
  border-radius: var(--border-radius-4);
  color: hsla(var(--color-neutral), var(--alpha-secondary));
  overflow-x: hidden;
  padding: var(--px-8) var(--px-12);
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;

  &[data-headlessui-state='active'] {
    background-color: hsla(var(--color-neutral), var(--alpha-background-light));
  }

  &:hover {
    background-color: hsla(
      var(--color-neutral),
      var(--alpha-background-medium)
    );
  }

  &[data-headlessui-state='active']:hover {
    background-color: hsla(var(--color-neutral), var(--alpha-background-heavy));
  }

  & + & {
    margin-top: var(--px-4);
  }
}

.graphiql-doc-explorer-search-type {
  color: hsl(var(--color-info));
}

.graphiql-doc-explorer-search-field {
  color: hsl(var(--color-warning));
}

.graphiql-doc-explorer-search-argument {
  color: hsl(var(--color-secondary));
}

.graphiql-doc-explorer-search-divider {
  color: hsla(var(--color-neutral), var(--alpha-secondary));
  font-size: var(--font-size-hint);
  font-weight: var(--font-weight-medium);
  margin-top: var(--px-8);
  padding: var(--px-8) var(--px-12);
}

.graphiql-doc-explorer-search-empty {
  color: hsla(var(--color-neutral), var(--alpha-secondary));
  padding: var(--px-8) var(--px-12);
}
